package router

import (
	"net/http"
	"sys-manager/hdoiresl"

	"github.com/gin-gonic/gin"
)

func Init() *gin.Engine {
	// 1.创建路由
	r := gin.Default()

	r.GET("/", func(c *gin.Context) {
		c.String(http.StatusOK, "hello World!")
	})

	r.POST("/login", hdoiresl.Login)

	r.POST("/userRole", hdoiresl.UserRole)

	r.POST("/RoleRole", hdoiresl.RoleNode)
	r.GET("/userNodeList", hdoiresl.UserNodeList)
	r.GET("/RoleNodeList", hdoiresl.RoleNodeList)
	r.GET("/orderList", hdoiresl.OrderList)
	r.GET("/xq", hdoiresl.Xq)
	return r
}
